# @Version        : 1.0
# @Update Time    : 2024/6/16 15:46
# @File           : cache.py
# @IDE            : PyCharm
# @Desc           : 文件描述信息
from typing import Optional
from fastapi import Request, Response


def custom_key_builder(
    func,
    namespace: Optional[str] = "",
    request: Request = None,
    response: Response = None,
    *args,
    **kwargs,
):
    """自定义key构造器"""
    cache_key = f"{namespace}:{func.__module__}:{func.__name__}:{args}:{kwargs}"
    return cache_key
